package com.atguigu.springcloud.feign;

import com.atguigu.springcloud.api.Result;
import com.atguigu.springcloud.service.PaymentService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : wenchao.long
 * @date : Created in 2020/12/17 16:23 周四
 * @description :
 */
@RestController
@AllArgsConstructor
public class PaymentHystrixClient implements IPaymentHystrixClient {

    private final PaymentService paymentService;

    @Override
    public Result<String> paymentInfo(Integer id) {
        return Result.data(paymentService.paymentInfo(id));
    }

    @Override
    public Result<String> paymentInfoTimeout(Integer id) {
        return Result.data(paymentService.paymentInfoTimeOutClient(id));
    }
}
